GET whatismyip.fr/raw/
nano ~/getip
GET whatismyip.fr/raw/ > .myip echo "" >> .myip sleep 1 GET whatismyip.fr/raw/ >> .myip echo "" >> .myip sleep 1 GET whatismyip.fr/raw/ >> .myip echo "" >> .myip
sh ~/getip
cat ~/.myip
92.122.18.135 92.122.18.135 92.122.18.135
cat ~/.myip | msmtp johnny@whitehouse.gov
cat ~/.myip | mail johnny@whitehouse.gov
nano ~/getip
Subject:MaBoxMeParle > .myip GET whatismyip.fr/raw/ >> .myip echo "" >> .myip sleep 1 GET whatismyip.fr/raw/ >> .myip echo "" >> .myip sleep 1 GET whatismyip.fr/raw/ >> .myip echo "" >> .myip cat .myip | msmtp johnny@whitehouse.gov
chmod 700 ~/getip
sh ~/getip
Le système crontab intégré à unix/linux permet une programmation simple de l'exécution de commandes et scripts.
crontab -l > cron
nano cron
23 8,12,15,18 1-5 * * sh /home/johnny/getip # à 08:23 12:23 15:23 et 18:23, du 1er au 5ème jour de la semaine # parce que les soirs et week-end je suis à la maison # et que c'est encore plus simple de récupérer mon IP
crontab ~/cron
crontab -l
... 23 8,12,15,18 1-5 * * sh /home/johnny/getip ...
(23 8,12,15,18 1-5 * *) donne bien les jours 1 à 5 dans la semaine alors que (23 8,12,15,18 * * 1-5) donne les jours 1 à 5 du mois
rm ~/cron
kerkael création de la page le 23/08/2009